package com.ruoyi.fatigue.domain.entity;

import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 疲劳检测记录表
 * @author Administrator
 * @TableName fatigue_detection_log
 */
@EqualsAndHashCode(callSuper = true)
@TableName(value ="fatigue_detection_log",autoResultMap = true)
@Data
public class DetectionLog extends BaseEntity implements Serializable {
    /**
     * 记录id
     */
    @TableId(value = "log_id")
    private Long logId;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 当前时间
     */
    @TableField(value = "`current_time`")
    private Date currentTime;

    /**
     * 疲劳状态，0：非疲劳状态，1：疲劳状态
     */
    @TableField(value = "tired_status")
    private Integer tiredStatus;

    /**
     * 疲劳程度分数
     */
    @TableField(value = "tired_value")
    private BigDecimal tiredValue;

    /**
     * 是否闭眼，0：睁眼，1：闭眼
     */
    @TableField(value = "eye_status")
    private Integer eyeStatus;

    /**
     * 是否打哈欠，0：未打哈欠，1：打哈欠
     */
    @TableField(value = "yawn_status")
    private Integer yawnStatus;

    /**
     * 是否点头，0：没点头，1：点头
     */
    @TableField(value = "nod_status")
    private Integer nodStatus;

    /**
     * 识别人脸框中心点的温度
     */
    @TableField(value = "face_temp")
    private BigDecimal faceTemp;

    /**
     * 眼部关键点索引和坐标
     */
    @TableField(value = "eye_point_coord")
    private String eyePointCoord;

    /**
     * RGB图像识别人脸框的中心点坐标，人脸框的宽度和高度，示例：[x,y,w,h]
     */
    @TableField(value = "rgb_face_box",typeHandler = JacksonTypeHandler.class)
    private JSONArray rgbFaceBox;

    /**
     * 红外图像识别人脸框的中心点坐标，人脸框的宽度和高度
     */
    @TableField(value = "infra_face_box",typeHandler = JacksonTypeHandler.class)
    private JSONArray infraFaceBox;

    /**
     * 眼部纵横比
     */
    @TableField(value = "ear_value")
    private BigDecimal earValue;

    /**
     * 嘴部纵横比
     */
    @TableField(value = "mar_value")
    private BigDecimal marValue;

    /**
     * 俯仰角
     */
    @TableField(value = "pitch_value")
    private BigDecimal pitchValue;

    /**
     * 翻滚角
     */
    @TableField(value = "roll_value")
    private BigDecimal rollValue;

    /**
     * 偏航角
     */
    @TableField(value = "yaw_value")
    private BigDecimal yawValue;

    /**
     * 是否删除标记，0：未删除，1：已删除
     */
    @TableLogic(value = "0",delval = "1")
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
